import http from '@/apis/http'
import {
  studentByClassIdPath,
  courseIdBySubjectIdAndStageIdPath,
  roleByTeacherIdPath,
  adminListPath,
  teachingInfoPath
} from './path'
import { ACCOUNT_CENTER_SYSTEM, dreamQuestionBank } from '@/apis'

export const postStudentByClassId = params => {
  return http.post(`${ACCOUNT_CENTER_SYSTEM}${studentByClassIdPath}`, params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
export const getCourseId = params => {
  return http.get(
    `${dreamQuestionBank}${courseIdBySubjectIdAndStageIdPath}?subject_id=${params.subjectId}&stage_id=${params.stageId}`
  )
}

export const getRoleByTeacherId = params => {
  return http.get(
    `${ACCOUNT_CENTER_SYSTEM}${roleByTeacherIdPath}?teacher_id=${params.teacherId}&school_id=${params.schoolId}`
  )
}
// 获取管理员列表
export const getAdminList = params => {
  return http.get(
    `${ACCOUNT_CENTER_SYSTEM}${adminListPath}?school_id=${params.schoolId}&role_code=${params.roleCode}&page=1&page_size=100`
  )
}

export const postTeachingInfo = async data => {
  return http.post(ACCOUNT_CENTER_SYSTEM + teachingInfoPath, data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
